package com.skt.common_hr.common
{
	import flash.display.Sprite;
	
	import mx.controls.Alert;
	import mx.effects.Parallel;
	import mx.effects.Sequence;
	import mx.effects.Zoom;
	import mx.events.CloseEvent;

	public class PsHrAlert
	{
		public static function showMessage(msg:String, title:String = "확인", parent:Sprite=null):void
		{
			var newAlert:Alert = Alert.show(msg, title, 4, parent);
			newAlert.width = 300;
			newAlert.height = 120;
		}

//shgoo : 2009.10.09
		public static function showMessageSize(msg:String, width:Number, height:Number, title:String = "확인", parent:Sprite=null):void
		{
/*			
			if(sizeAlert == null) {
				sizeAlert = Alert.show(msg, title, 4, parent);
			
				sizeAlert.width = width;
				sizeAlert.height = height;
			}
*/
			var newAlert:Alert = Alert.show(msg, title, 4, parent);
			newAlert.width = width;
			newAlert.height = height;
		}
//////////////////////
	
		/**
         * Alert.show 재 정의
         */
		public static function showMsgYesNo( msg:String, title:String, parent:Sprite, yesFunction:Function, noFunction:Function, 
											 Yeslabel:String = "YES", Nolabel:String = "NO"): void
        {
        	var iconImage :Class = null;
        	var tmpTitle :String = "확인";
			
			if (title == "") title = tmpTitle ;
			Alert.yesLabel = Yeslabel;
			Alert.noLabel = Nolabel;
			
            var newAlert:Alert = Alert.show(msg, title, Alert.YES|Alert.NO, parent,
					                function(event:CloseEvent): void {
					                    if (event.detail == Alert.YES) {
					                        if (yesFunction != null) yesFunction();
					                    } else {
					                        if (noFunction != null) noFunction();
					                    }
					                },iconImage, Alert.NO
					            );
			newAlert.width = 400;
			newAlert.height = 140;		            
        }
		
		public static function setEffect():void
		{
			var sequence:Sequence = new Sequence();
			var parallel:Parallel = new Parallel();
			parallel.addChild(new Zoom());
		}
	}
}